//
//  HSCommonFile.swift
//  HomeSchoolDemo
//
//  Created by Mac on 16/9/27.
//  Copyright © 2016年 chendong. All rights reserved.
//

import UIKit

let screenW = UIScreen.main.bounds.width
let screenH = UIScreen.main.bounds.height

///服务器ip地址的存储KEY
let cd_ipKey:String = "ipText"

///只读计算型属性
var baseURLStr:String? {
    ///baseURL
    guard let saveIp = UserDefaults.standard.value(forKey: cd_ipKey) as? String else {
        return nil
    }
    return saveIp + "zao/interface/"
}

///记录登录状态的key
let isLogin: String = "isLogin"

//获得用户信息的保存路径
let saveUserfoPath = (NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, true).last ?? "") + "/userInfoFile.plist"

/// 获得保存的用户信息数据
//因为保证任何地方都可以获取最新的信息，需要使用计算型属性
var userInfo:NSDictionary {
    return NSDictionary(contentsOfFile: saveUserfoPath)?["data"] as! NSDictionary
}

//计算视图的宽度
let replayViewW:CGFloat = screenW - (50 + 8 * 3)





